<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>prevent 修饰符</title>
</head>
<body>
<div id="app">
    <form action="https://www.baidu.com/s" method="get">
        <input type="text" name="wd">
        <input type="submit" value="百度一下">
        <input type="submit" value="百度一下" @click="onsubmit">
        <!--  prevent 作用：阻止默认事件行为  -->
        <!--  input sumbit 的作用：用于将所有用户值提交到表单处理程序  -->
        <input type="submit" value="百度一下" @click.prevent="onsubmit">
    </form>
</div>

<script src="../../../../../js/vue.global.js"></script>
<script>
    const app = Vue.createApp({
        data() {
            return {}
        },
        methods: {
            onsubmit() {
                console.log("调用了 onsubmit 函数");
            }
        }

    })

    app.mount("#app")
</script>
</body>
</html>